<script setup>
import { inject, ref } from "vue";
import { onLoad, onShow } from "@dcloudio/uni-app";

onLoad((e) => {
  status.value = e.status;
});
const status = ref();
// 返回补货
const goGoorder = () => {
  uni.reLaunch({ url: "/pages/cloudlibrary/replenishment/index" });
};

// 查看库存
const goOrder = () => {
  uni.reLaunch({ url: "/pages/cloudlibrary/mystock/index" });
};

const goback = () => {
  uni.reLaunch({ url: "/pages/order/orderlist/index?status=-1" });
};
</script>
<template>
  <view class="paycontent">
    <view class="pay-hx" v-if="status == 200"> </view>
    <view class="pay-hx pay-err" v-else> </view>
    <view class="pay-res" v-if="status == 200">
      <view class="pay-res-img">
        <image src="@/static/icon_successful.png" mode=""></image>
      </view>
      <view class="pay-res-name"> 补货成功 </view>
      <view class="pay-res-dec"> 您的商品库存已增加 </view>
      <view class="pay-res-k">
        <view class="pay-res-see" @click="goGoorder"> 返回补货 </view>
        <view class="pay-res-bt" @click="goOrder"> 查看库存 </view>
      </view>
    </view>

    <view class="pay-res" v-else>
      <view class="pay-res-img">
        <image src="@/static/icon_error.png" mode=""></image>
      </view>
      <view class="pay-res-name"> 补货失败 </view>
      <view class="pay-res-dec"> 补货失败,可前往未支付订单支付</view>
      <view class="pay-res-k">
        <view class="pay-res-see refresh-pay" @click="goback"> 返回 </view>
      </view>
    </view>
  </view>
</template>

<style lang="scss" scoped>
@import "index.scss";
</style>
